﻿using System;
using System.Windows.Media;

namespace personalplaner.business.dienstplan
{
	public class DienstOverviewItem : ItemBase
    {
        public static Color DienstCountPlusColor
        {
            get;
            set;
        }

        public static Color DienstCountEnoughColor
        {
            get;
            set;
        }

        public static Color DienstCountMinusColor
        {
            get;
            set;
        }
        
        DateTime _datum;
		public DateTime Datum
		{
			get { return _datum; }
			set
			{
				_datum = value;
				RaisePropertyChanged("Datum");
			}
		}

		//Color _color;
		public Color Color
		{
			get
			{
				if (DienstCount < EinsatzProTag)
                    return DienstCountMinusColor;
				if (DienstCount > EinsatzProTag)
                    return DienstCountPlusColor;

                return DienstCountEnoughColor;
			}
		}

		int _dienstCount;
		public int DienstCount
		{
			get { return _dienstCount; }
			set
			{
				_dienstCount = value;
				RaisePropertyChanged("DienstCount");
				RaisePropertyChanged("Color");
                RaisePropertyChanged("Difference");
			}
		}

        public int Difference
        {
            get
            {
                return DienstCount - EinsatzProTag;
            }
        }

		int _einsatzProTag;
		public int EinsatzProTag
		{
			get { return _einsatzProTag; }
			set
			{
				_einsatzProTag = value;
				RaisePropertyChanged("EinsatzProTag");
			}
		}
	}
}
